<?php

include "../../dbaccess.php";
$connector = mysql_pconnect($dbserver, $dbuser, $dbpassword) or die(mysql_error($connector));
unset ($dbuser, $dbpassword, $dbserver);

mysql_select_db('gasilvis_EggenCards2') or die(mysql_error());

$UserName= trim($_GET['UserName']); 
 
$q= "SELECT * FROM Users WHERE UserName=\"".urldecode($UserName)."\"";

$callback = trim($_GET['callback']);

$dataReturned = mysql_query($q) or die(mysql_error());

echo $callback;

echo '([';
$f= false;
while($row = mysql_fetch_array($dataReturned)){
   if($f) echo ',';  $f= true;
   echo '{';
   $i= $row['UserID'];   echo "\"UserID\":$i,";
   $i= $row['EChrs'];    echo "\"EChrs\":$i,";
   $i= $row['ECcnt'];    echo "\"ECcnt\":$i";
   echo '}';
}
echo '])';

?>